package ken.spring.cloud.alibaba.service;

import ken.spring.cloud.alibaba.fallback.EchoServiceFallbackFactory;
import ken.spring.cloud.alibaba.po.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;

/**
 * <ul>
 * <li>Title: EchoService</li>
 * <li>Description: TODO </li>
 * </ul>
 *
 * @author swc
 * @date 2022-06-25 15:38
 */

/*
@FeignClient(name = "nacos-provider",
        fallback = EchoServiceFallback.class, configuration = FeignConfiguration.class,url = "http://localhost:8081/")
*/

@FeignClient(name = "nacos-provider",
        fallbackFactory = EchoServiceFallbackFactory.class)
public interface EchoService {

    @GetMapping(value = "/echo/{str}")
    String echo(@PathVariable("str") String str);

    @GetMapping(value = "/user/list")
    List<User> queryAll();
}
